#include"bits/stdc++.h"
using namespace std;
int n,total_day,simple_day;
int main()
{
	cin>>n;
	for (int i=1; ;++i)
	{
		if (n==0)
		{
			break;
		}
		if (simple_day==0&&n%3==1)
		{
			simple_day=i;
		}
		n-=ceil(n/3.0);
		++total_day;
	}
	cout<<total_day<<" "<<simple_day;
}
